
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
import temp.sort;

public class test {

    public static void main(String[] args) {
        int n = 1000;
        if (args.length > 1) {
            try {
                n = Integer.parseInt(args[1]);
            } catch (Exception ex) {
            }
        }
        Integer[] array = new Integer[n];
        Random rand = new Random(System.currentTimeMillis());
        for (int i = 0; i < array.length; i++) {
            array[i] = rand.nextInt();
        }
        System.out.println(Arrays.toString(array));
        long timeStart = System.currentTimeMillis();
        System.out.println("\nStart: " + System.currentTimeMillis());
        sort.sort(array);
        long timeEnd = System.currentTimeMillis();
        System.out.println("\nEnd: " + System.currentTimeMillis());
        System.out.println("\nResult: " + (timeEnd-timeStart));
        System.out.println(Arrays.toString(array));
    }
}